package com.security.demo.entity;

import java.util.Date;

import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonView;
import com.security.demo.volidator.MyConstraint;

/**
 * <p>Title: UserEntity</p>
 * <p>Description: </p> 
 * @author liukang
 * @date 2019年4月18日
 */
public class UserEntity {

	public interface UserDetailView extends UserSimpleView{};

	public interface UserSimpleView{};
	
	private String id;
	
	@MyConstraint(message = "测试")
	private String username;

	@NotBlank(message = "密码不能为空")
	private String password;

	/**
	 * 
	 */
	@Past(message = "生日必须是过去时")
	private Date createTime;
	
	/**
	 * @return the username
	 */
	@JsonView(UserSimpleView.class)
	public String getUsername() {
		return username;
	}

	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return the password
	 */
	@JsonView(UserDetailView.class)
	public String getPassword() {
		return password;
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	@JsonView(UserSimpleView.class)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@JsonView(UserSimpleView.class)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	
}
